package com.demo;

public class Student {
    private String name;
    private int age;


    // getter / setter
    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    // 自定义方法
    public void introduce() {
        System.out.println("大家好，我是 " + name + "，今年 " + age + " 岁。");
    }

    @Override
    public String toString() {
        return "Student{name='" + name + "', age=" + age + "}";
    }
}